package cmo.neutech.day10.HomeWork.d6;

import java.util.Random;

public class TextStudent {
    public static void main(String[] args) {
        Student[] st = new Student[5];
        Random r = new Random();
        for(int i=0;i<st.length;i++){
            String sno = "Student"+r.nextInt(10);
            String name = "编号"+r.nextInt(10);
            String sex = r.nextInt(2)==0?"男":"女";
            int age = 18+r.nextInt(10);
            double speech = r.nextInt(100);
            double midterm = r.nextInt(100);
            double finalExam = r.nextInt(100);
            double works = r.nextInt(100);
            double opCapacity = r.nextInt(100);
            double englishWriting = r.nextInt(100);
            int x = r.nextInt(3);
            switch (x) {
                case 0:
                    st[i] = new English(sno, name, sex, age, speech, midterm, finalExam);
                    break;
                case 1:
                    st[i] = new Pc(sno, name, sex, age, opCapacity, englishWriting, midterm, finalExam);
                    break;
                case 2:
                    st[i] = new Arts(sno, name, sex, age, speech, works, midterm, finalExam);
                    break;
            }
        }

        for(Student student : st){
            student.overallScore = student.getOverallScore();
            System.out.format("学号：%s 姓名：%s 性别：%s 年龄：%d 综合成绩：%.2f%n",student.sno,student.name,student.sex,student.age,student.overallScore);
        }
    }


}
